<!--
 * @Description: 设备效率
 * @Author: lwx
 * @Date: 2022-06-17 09:20:30
 * @LastEditors: lwx
 * @LastEditTime: 2023-04-10 09:22:46
-->
<template>
  <div class="d-flex">
    <ratio-chart id="ratioChart1" :cdata="cdata1" />
    <ratio-chart id="ratioChart2" :cdata="cdata2" />
  </div>
</template>

<script>
import { timerMixins } from '@/common/mixins/timerMixins.js'
import ratioChart from '@/components/echart/ratioChart'
import { machineEfficiency } from '@/api/dashboard.js'
export default {
  mixins: [timerMixins],
  components: {
    ratioChart
  },
  data() {
    return {
      cdata1: { name: '稼动率', percent: 0, },
      cdata2: { name: 'OEE率', percent: 0, }
    }
  },
  methods: {
    async initData() {
      const { data } = await machineEfficiency()
      this.cdata1.percent = data.speed_motion_rate.substr(0, data.speed_motion_rate.length - 1)
      this.cdata2.percent = data.oee_rate.substr(0, data.oee_rate.length - 1)
    }
  }
}

</script>
<style lang='scss' scoped></style>